#pragma once

#import <msxml3.dll>
#include <vector>

#include "Renderable2D.h"
#include "Animation.h"


namespace Graphics
{
	class AnimationSet :public Renderable2D
	{
	private:

		class AnimationImpl:public Animation
		{
		private:
			Position m_Pos;
		public:
			AnimationImpl(void);
			~AnimationImpl(void);

			// set the position of sprite
			void SetPos(int x, int y);
			virtual const Position& GetPos(void);
		};

		float m_Speed;
		int m_ID;
		ANI_STATE m_State;
		
		std::string m_Description;
		vector<AnimationImpl*> m_Animations;
		vector<std::string> m_Names;

	public:
		AnimationSet(void);
		virtual ~AnimationSet(void);

		virtual float GetSpeed(void) = 0;
		virtual int GetID(void) = 0;

		virtual bool RenderImpl(void);
		
		bool LoadXML(const MSXML2::IXMLDOMNodePtr& pNode);
		bool Load(std::string filename);

		ANI_STATE Play(void);
		ANI_STATE Stop(void);

		ANI_STATE GetState(void);
		//void SetSpeed(float speed);
		//void SetID(int id);
		int NameToID(std::string& name);
		const std::string& GetDescription(void);
	};
}